<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
       <button @click="vif=!vif">切换v-if显示影藏</button>
       <button @click="vshow=!vshow">切换v-show显示影藏</button>
       <div v-if="vif" style="background-color: red; width: 200px; height: 200px;">
        v-if测试
       </div>
       <hr>
       <div v-show="vshow" style="background-color: yellow; width: 200px; height: 200px;">
        v-show测试
       </div>
    </div>
</body>

<script src="./node_modules/vue/dist/vue.js" ></script>
<script>
    new Vue({
        el:"#app",
        data() {
            return {
                vif:true,
                vshow:true
            }
        },
    })
</script>
</html>